<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- JS与CSS引用 [START] -->
<%@include file="/WEB-INF/include/head-common.jsp" %>
<!-- JS与CSS引用 [END] -->

<title>为用户分配角色</title>
<script type="text/javascript">
// 用户拥有的角色
var rolepks = ${rolepks };

// 加载事件
$(function(){
	var roles = document.getElementsByName("pkRoleinfo");
	for(var i=0; i<roles.length; i++){
		for(var k=0; k<rolepks.length; k++){
			if(roles[i].value==rolepks[k]){
				roles[i].checked = true;
				break;
			}
		}
	}
});
</script>


</head>
<body>
<div id="main_container">

	<!-- 网页顶部信息 [START] -->
	<%@include file="/WEB-INF/include/header.jsp" %> 
	<!-- 网页顶部信息 [END] -->
	
    
    <div class="main_content">
    	<!-- 网页顶部导航菜单 [START] -->
    	<%@include file="/WEB-INF/include/main-menu.jsp" %>
        <!-- 网页顶部导航菜单 [END] -->            
                    
    <div class="center_content">  
    
    
    
    <div class="left_content">       
            
    
    		<!-- 网页左侧菜单 [START] -->
            <%@include file="/WEB-INF/include/sidebarmenu.jsp" %>
            <!-- 网页左侧菜单 [END] --> 
            
            
    </div>  
    
    
    <!-- 右侧主要内容区 -->
    <div class="right_content">
    	<div class="position">
	    	<div class="position_box">当前位置：<%@include file="/WEB-INF/include/sitemap.jsp" %></div>
	    </div>              
        
	<!-- 右侧顶部标题 -->
    <h2>为用户分配角色</h2> 
    <div>
		<div>系统编号：<span style="font-weight: bold;color:#48f;">${user.pkUserinfo }</span></div>
		<div>登录名称：<span style="font-weight: bold;color:#48f;">${user.loginid }</span></div>
		<div>用户姓名：<span style="font-weight: bold;color:#48f;">${user.realname }</span></div>
	</div>
    <form action="auth/user/saveallot.do" method="post">
		<input name="pkUserinfo" type="hidden" value="${user.pkUserinfo }"/>
		<div>
		<ul id="roles">
			<c:forEach var="role" items="${roles }">
			<li><label><input name="pkRoleinfo" type="checkbox" value="${role.pkRoleinfo }"/>${role.rolename }</label></li>
			</c:forEach>
		</ul>
		<input type="submit" value="保 存"/>
		<a href="auth/user.do">取消，并返回用户列表</a>	
		</div>
	</form>
     
     
     
     
     
     </div>
     <!-- end of right content-->
            
                    
  </div>   
  <!--end of center content -->               
                    
                    
    
    
    <div class="clear"></div>
    </div> <!--end of main content-->
	
    
    <div class="footer">
    
    	<div class="left_footer">IN ADMIN PANEL | Powered by <a href="http://indeziner.com">INDEZINER</a></div>
    	<div class="right_footer"><a href="http://indeziner.com"><img src="images/indeziner_logo.gif" alt="" title="" border="0" /></a></div>
    
    </div>

</div>		
</body>
</html>
